<%--
 * list.jsp
 *
 * Copyright (C) 2013 Universidad de Sevilla
 * 
 * The use of this project is hereby constrained to the conditions of the 
 * TDG Licence, a copy of which you may download from 
 * http://www.tdg-seville.info/License.html
 --%>

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@ taglib prefix="acme" tagdir="/WEB-INF/tags" %>

<form:form action="${requestURI}" modelAttribute="${type}">
	<form:hidden path="id" />
	<form:hidden path="version" />
	<form:hidden path="userAccount.authorities" />
	
	
	<!-- UserAccount -->
	<acme:textbox code="account.username" path="userAccount.username"/>
	<acme:password code="account.password" path="userAccount.password"/>
	<acme:password code="account.password.repeat" path="repeatedPassword"/>
	
	
	<!-- Actor -->
	
	
	<acme:textbox code="account.name" path="name"/>
	<acme:textbox code="account.surname" path="surname"/>
	<acme:textbox code="account.email" path="email"/>
	
	<!-- Participant -->
	<jstl:if test="${isParticipant}">
	<acme:textbox code="account.creditcard.holderName" path="creditCard.holderName"/>
	<acme:textbox code="account.creditcard.brandName" path="creditCard.brandName"/>
	<acme:textbox code="account.creditcard.number" path="creditCard.number"/>
	<acme:textbox code="account.creditcard.expirationMonth" path="creditCard.expirationMonth"/>
	<acme:textbox code="account.creditcard.expirationYear" path="creditCard.expirationYear"/>
	<acme:textbox code="account.creditcard.cvv" path="creditCard.cvv"/>
	</jstl:if>
	
	<form:checkbox path="hasAccepted"/><spring:message code="account.legal.checkbox"/> <a href="welcome/legal.do"><spring:message code="account.legal.legaladvice"/></a>
	
	<br>
	<!-- Buttons -->
	<input type="submit" name="save"
			value="<spring:message code="account.save" />" 
			onclick="return confirm('<spring:message code="account.legaldataadvice" />')" />&nbsp;
	<acme:cancel url="welcome/index.do" code="account.cancel"/>

	
</form:form>

